package utilities.event;

import java.util.Date;
import java.util.List;

import org.hibernate.Session;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;

import utilities.Updatable;
import utilities.utilities_components.Duration;

public class NILListener implements EventListener{
	private Duration duration;
	private Updatable updateItem;
	
	public NILListener( Duration duration, Updatable updateItem ){
		this.duration = duration;
		this.updateItem = updateItem;
	}
	
	public void onEvent( Event event ){
		Date begin = duration.getBegin();
		if( begin != null ){
			Date end = duration.getEnd();
			
			updateItem.update( getData( begin, end, session ) );
		}
	}
	
	//子List中字段"结账时间", "客人帐号", "主客", "主房", "登记时间", "来源", "客人类型", "总消费", "结账员", "登记员"
	//参数: begin起始日期 end截止日期,统计该日期段内的记录
	private List getData( Date begin, Date end, Session session ){
		return null;
	}
}
